<!DOCTYPE html>

<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->

<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->

<!--[if !IE]><!--> <html lang="zh-CN"> <!--<![endif]-->

<!-- BEGIN HEAD -->

<head>

	<meta charset="utf-8" />

	<title>订单管理</title>

	<meta content="width=device-width, initial-scale=1.0" name="viewport" />

	<meta content="" name="description" />

	<meta content="" name="author" />

	<!-- BEGIN GLOBAL MANDATORY STYLES -->

	<link href="__PUBLIC__/media/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>

	<link href="__PUBLIC__/media/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"/>

	<link href="__PUBLIC__/media/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>

	<link href="__PUBLIC__/media/css/style-metro.css" rel="stylesheet" type="text/css"/>

	<link href="__PUBLIC__/media/css/style.css" rel="stylesheet" type="text/css"/>

	<link href="__PUBLIC__/media/css/style-responsive.css" rel="stylesheet" type="text/css"/>

	<link href="__PUBLIC__/media/css/default.css" rel="stylesheet" type="text/css" id="style_color"/>

	<link href="__PUBLIC__/media/css/uniform.default.css" rel="stylesheet" type="text/css"/>

	<!-- END GLOBAL MANDATORY STYLES -->

	<!-- BEGIN PAGE LEVEL STYLES -->

	<link rel="stylesheet" type="text/css" href="__PUBLIC__/media/css/select2_metro.css" />

	<link rel="stylesheet" href="__PUBLIC__/media/css/DT_bootstrap.css" />

	<!-- END PAGE LEVEL STYLES -->

	<link rel="shortcut icon" href="__PUBLIC__/media/image/favicon.ico" />
	<style type="text/css">
	.tabhide{
		background: #eee;
	}
	</style>

</head>

<!-- END HEAD -->

<!-- BEGIN BODY -->

<body class="page-header-fixed">
<input type="hidden" id="token" value="@#$_GET['token']#@">
	<!-- BEGIN HEADER -->

	<div class="header navbar navbar-inverse navbar-fixed-top">
		<!-- BEGIN TOP NAVIGATION BAR -->
		<div class="navbar-inner">
			<div class="container-fluid">
				<!-- BEGIN LOGO -->
				<a class="brand" href="__APP__/Home/AdminPage/index?token=@#$_GET['token']#@">
				<img src="__PUBLIC__/media/image/logo.png" alt="logo" />
				</a>
				<!-- END LOGO -->
				<!-- BEGIN RESPONSIVE MENU TOGGLER -->
				<a href="javascript:;" class="btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse">
				<img src="__PUBLIC__/media/image/menu-toggler.png" alt="" />
				</a>          
				<!-- END RESPONSIVE MENU TOGGLER -->            
				<!-- BEGIN TOP NAVIGATION MENU -->              
				<ul class="nav pull-right">
					<!-- BEGIN USER LOGIN DROPDOWN -->
					<li class="dropdown user">
						<a href="#" class="dropdown-toggle" data-toggle="dropdown">
						<img alt="" src="__PUBLIC__/media/image/avatar1_small.jpg" />
						<span class="username">账户</span>
						<i class="icon-angle-down"></i>
						</a>
						<ul class="dropdown-menu">
							
							<li><a href="__APP__/Home/AccountPage/logout"><i class="icon-key"></i> 退出</a></li>
						</ul>
					</li>
					<!-- END USER LOGIN DROPDOWN -->
				</ul>
				<!-- END TOP NAVIGATION MENU --> 
			</div>
		</div>
		<!-- END TOP NAVIGATION BAR -->
	</div>

	<!-- END HEADER -->

	<!-- BEGIN CONTAINER -->

	<div class="page-container row-fluid">

		<!-- BEGIN SIDEBAR -->

		<div class="page-sidebar nav-collapse collapse">
			<!-- BEGIN SIDEBAR MENU -->        
			<ul class="page-sidebar-menu">
				<li class=" start ">
					<a href="__APP__/Home/AdminPage/index?token=@#$_GET['token']#@">
					<i class="icon-home"></i> 
					<span class="title">HOME</span>
					</a>
				</li>
				<li class="">
					<a href="__APP__/Home/AdminPage/user?token=@#$_GET['token']#@">
					<i class="icon-cogs"></i> 
					<span class="title">用户管理</span>
					</a>
				</li>
				<li >
					<a href="__APP__/Home/AdminPage/staff?token=@#$_GET['token']#@">
					<i class="icon-table"></i> 
					<span class="title">技术员管理</span>
					</a>
				</li>
				<li class="active">
					<a href="__APP__/Home/AdminPage/order?token=@#$_GET['token']#@">
					<i class="icon-bookmark-empty"></i> 
					<span class="title">订单管理</span>
					</a>
				</li>
				<li class="last">
					<a href="__APP__/Home/AdminPage/set?token=@#$_GET['token']#@">
					<i class="icon-user"></i> 
					<span class="title">设置</span>
					</a>
				</li>
			</ul>
			<!-- END SIDEBAR MENU -->
		</div>

		<!-- END SIDEBAR -->

		<!-- BEGIN PAGE -->

		<div class="page-content">

			<!-- BEGIN PAGE CONTAINER-->        

			<div class="container-fluid">

				<!-- BEGIN PAGE HEADER-->

				<div class="row-fluid">

					<div class="span12">

						<!-- BEGIN PAGE TITLE & BREADCRUMB-->

						<h3 class="page-title">

							订单管理

						</h3>

						<ul class="breadcrumb">

							<li>

								<i class="icon-home"></i>

								<a href="__APP__/Home/AdminPage/index?token=@#$_GET['token']#@">Home</a>

								<i class="icon-angle-right"></i>

							</li>

							<li>

								<a href="#">订单管理</a>

								<i class="icon-angle-right"></i>

							</li>

						</ul>

						<!-- END PAGE TITLE & BREADCRUMB-->

					</div>

				</div>

				<!-- END PAGE HEADER-->

				<!-- BEGIN PAGE CONTENT-->

				<div class="row-fluid">

					<div class="span9">

						<!-- BEGIN EXAMPLE TABLE PORTLET-->

						<div class="portlet box green">

							<div class="portlet-title">

								<div class="caption"><i class="icon-globe"></i>订单管理</div>

								<div class="tools">

									<a href="javascript:;" class="reload"></a>

								</div>

							</div>

							<div class="portlet-body">
								<table width="100%">	
									<tbody>
										<tr>
											<td>
												<table width="100%" class="table table-striped table-bordered table-hover table-full-width" id="sample_1">
													<tr>
													    <th width="10%">详 情</th>
														<th width="20%">订单号</th>

														<th width="20%">技术员</th>

														<th width="20%">客户名</th>

														<th width="20%">订单状态</th>
                                                        <th width="10%">操作</th>
													
													</tr>
												</table>
												<foreach name="order_list" item="vo">
												<!--一个订单的信息开始-->
												<table width="100%" class="table table-striped table-bordered table-hover table-full-width" id="sample_1">
													<tr>
													<td width="10"><button orderid="@#$vo.order_id#@" class="btnhide">+</button></td>
													<td width="20%">@#$vo.number#@</td>
													<td width="20%"><a href="__APP__/Home/AdminPage/order/staff_id/@#$vo.staff_id#@?token=@#$_GET['token']#@">@#$vo.staff_name#@</a></td>
													<td width="20%"><a href="__APP__/Home/AdminPage/order/user_id/@#$vo.user_id#@?token=@#$_GET['token']#@">@#$vo.user_name#@</a></td>
													<td width="20%">@#$vo.status#@</td>
													<td width="10%">
														<span class="cancel_order" ajaxid="@#$vo.order_id#@">
			<a href="#" id="cancel_order_@#$vo.order_id#@" >取消订单</a>
			</span>

													</td>
													</tr>
												</table>
											    <table id="order@#$vo.order_id#@" class="tabhide" width="100%">
													<tbody>
										            <tr><td width="15%">客户信息</td><td width="20%">&nbsp;</td><td width="15%">技术员信息</td><td width="15%">&nbsp;</td><td width="15%">订单动态</td></tr>
										            <tr><td>姓名：</td><td>@#$vo.user_name#@</td><td>姓名：</td><td>@#$vo.staff_name#@</td><td>报修时间：</td><td>@#$vo.time|date='Y-m-d H:i',####@</td></tr>
										            <tr><td>手机：</td><td>@#$vo.user_phone#@</td><td>手机：</td><td>@#$vo.staff_phone#@</td><td>分配技术员时间：</td><td>@#$vo.distribute_time|date='Y-m-d H:i',####@</td></tr>
										            <tr><td>电脑信息：</td><td>@#$vo.brand#@@#$vo.model#@@#$vo.buy_time|date='Y年m月',####@购买</td><td>邮箱：</td><td>@#$vo.staff_email#@</td><td>维修完成时间：</td><td>@#$vo.user_confirm_time|date='Y-m-d H:i',####@</td></tr>
										            <tr><td>故障信息：</td><td colspan="4">@#$vo.description#@</td></tr>
													<tr><td>订单是否被拒绝:</td><td colspan="4"><php> if($vo['isRefuse']){echo '该订单在'.date('Y年m月d日 H:i',$vo['refuseTime']).'被'.$vo['staffRefuseName'].'拒绝';}else{echo '否';}</php></td></tr>
										            </tbody>
									            </table>
									            </foreach>
									            <!--一个订单的结束-->
									            <div>	@#$page#@</div>
											</td>
										</tr>
									</tbody>

								</table>

							</div>

						</div>

						<!-- END EXAMPLE TABLE PORTLET-->

					</div>

					<div class="span3">

						<div class="portlet box grey">

							<div class="portlet-title">

								<div class="caption"><i class="icon-comments"></i></div>

							</div>

							<div class="portlet-body fuelux">
<form method="get" action="__APP__/Home/AdminPage/order_search/token/@#$_GET['token']#@">
								<label>

									<input type="text" name="key" class="m-wrap small">
									<button class="btn grey"><i class="icon-search"></i></button>
								</label>
</form>
								<table class="table table-striped table-bordered table-hover table-full-width dataTable" align="center">
									
									<tr><td><a href="__APP__/Home/AdminPage/order?token=@#$_GET['token']#@">所有订单</a></td></tr>
									<tr><td><a href="__APP__/Home/AdminPage/order/status/doin?token=@#$_GET['token']#@">活动订单</a></td></tr>
									<tr><td><a href="__APP__/Home/AdminPage/order/status/done?token=@#$_GET['token']#@">非活动订单</a></td></tr>
									<tr><td><a href="__APP__/Home/AdminPage/order/status/submitted?token=@#$_GET['token']#@">待分配订单</a></td></tr>
									<tr><td><a href="__APP__/Home/AdminPage/order/status/distributed?token=@#$_GET['token']#@">待技术员确认订单</a></td></tr>
									<tr><td><a href="__APP__/Home/AdminPage/order/status/confirmed?token=@#$_GET['token']#@">技术员已确认订单</a></td></tr>
									<tr><td><a href="__APP__/Home/AdminPage/order/status/completed?token=@#$_GET['token']#@">已完成订单</a></td></tr>
									<tr><td><a href="__APP__/Home/AdminPage/order/status/canceled?token=@#$_GET['token']#@">已取消订单</a></td></tr>
									<tr><td><a href="__APP__/Home/AdminPage/order/status/rejected?token=@#$_GET['token']#@">待重新分配订单</a></td></tr>
								</table>

							</div>

						</div>

					</div>

				</div>

				<!-- END PAGE CONTENT-->

			</div>

			<!-- END PAGE CONTAINER-->

		</div>

		<!-- END PAGE -->

	</div>

	<!-- END CONTAINER -->

	<!-- BEGIN FOOTER -->

	<div class="footer">

		<div class="footer-inner">

		</div>

		<div class="footer-tools">

			<span class="go-top">

			<i class="icon-angle-up"></i>

			</span>

		</div>

	</div>

	<!-- END FOOTER -->

	<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->

	<!-- BEGIN CORE PLUGINS -->

	<script src="__PUBLIC__/media/js/jquery-1.10.1.min.js" type="text/javascript"></script>

	<script src="__PUBLIC__/media/js/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>

	<!-- IMPORTANT! Load jquery-ui-1.10.1.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->

	<script src="__PUBLIC__/media/js/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>      

	<script src="__PUBLIC__/media/js/bootstrap.min.js" type="text/javascript"></script>



	<script src="__PUBLIC__/media/js/app.js"></script>

	<script>

		jQuery(document).ready(function() {       

		   App.init();

		   TableAdvanced.init();

		});

	</script>



<script type="text/javascript">
	var token=$("#token").val();
	$(".tabhide").hide();
	$(".btnhide").click(function(){
		var order_id=$(this).attr('orderid');
		$("#order"+order_id).toggle();
		//$(".tabhide").toggle();
	});

	//用户取消订单
	$(".cancel_order").on("click",function(){	
		if(confirm("确认要取消该订单吗?")){			
			var order_id=$(this).attr('ajaxid');
			$("#cancel_order_"+order_id).text('处理中..');
			//alert(order_id);return;
			$.post("__APP__/Home/Handle/cancel?token="+token, {order_id:order_id},//取消的订单号
				function(data){
					if(data.status==0){
						$("#cancel_order_"+order_id).text('取消失败,请重试');
						//document.location.reload("__APP__/Home/Index/order");
					}else{
						document.location.reload("__APP__/Home/IndexPage/order?token="+token);//重新加载网页
					}
			});
		}
	});
</script>

</body>

<!-- END BODY -->

</html>